package net.fdukedom.epicurus.resource;

import net.fdukedom.epicurus.domain.entity.Extension;

import java.util.Map;

/**
 * @author Dmitry Y. Kochelaev
 */
public interface ExtensionHandler {

    /**
     * Name of isVisble parameter.
     */
    public static final String IS_EXTENSION_VISIBLE = "isVisible";
       
    /**
     * Does the actions for current extension point. The obligatory item in the map, that
     * is returned, is "isVisible" of type Boolean. It reflects whether this extension is to be
     * shown.
     *
     * @param parameters map of parameters
     *
     * @return map of items to be put in request or used by extension point
     */
    public Map<String, Object> execute(Map<String, Object> parameters);

    /**
     * Returns name of page to be imported.
     *
     * @return name of page to be imported
     */
    public String getPresentation();

    /**
     * Returns extension.
     *
     * @return extension
     */
    public Extension getExtension();

    /**
     * Sets extension.
     *
     * @param extension extension to be set
     */
    public void setExtension(Extension extension);
}
